package com.jingzhe.core.web.converter;

import com.github.miemiedev.mybatis.paginator.domain.PageList;

/**
 * 适用dataTables的封装数据
 * @author wanghj
 *
 */
public class DataTablesResult<T> {
	
	public DataTablesResult(int draw, PageList<T> data) {
		super();
		this.draw = draw;
		this.data = data;
		this.recordsTotal = data.getPaginator().getTotalCount();
		this.recordsFiltered = data.getPaginator().getTotalCount();
	}

	public DataTablesResult() {
		super();
	}

	/**
	 * 原参数返回
	 */
	private int draw;
	
	/**
	 * 总记录数
	 */
	private int recordsTotal;
	
	/**
	 * 过滤后的总记录数
	 */
	private int recordsFiltered;
	
	/**
	 * 具体数据列表
	 */
	private PageList<T> data;

	public int getDraw() {
		return draw;
	}

	public void setDraw(int draw) {
		this.draw = draw;
	}

	public int getRecordsTotal() {
		return recordsTotal;
	}

	public void setRecordsTotal(int recordsTotal) {
		this.recordsTotal = recordsTotal;
	}

	public int getRecordsFiltered() {
		return recordsFiltered;
	}

	public void setRecordsFiltered(int recordsFiltered) {
		this.recordsFiltered = recordsFiltered;
	}

	public PageList<T> getData() {
		return data;
	}

	public void setData(PageList<T> data) {
		this.data = data;
	}
	
}
